package com.xuecheng.content.service;

import com.xuecheng.content.model.dto.CoursePreviewDto;
import com.xuecheng.content.model.po.CoursePublish;
import org.apache.ibatis.annotations.Mapper;

import java.io.File;

/**
 * 课程发布相关接口
 */
@Mapper
public interface CoursePublishService {

    /**
     * 获取课程预览信息
     * @param courseId
     * @return
     */
    CoursePreviewDto getCoursePreviewInfo(Long courseId);

    /**
     * 提交课程审核
     * @param companyId
     * @param courseId
     */
    void commitAudit(Long companyId, Long courseId);

    /**
     * 课程发布
     * @param companyId
     * @param courseId
     */
    void publish(Long companyId, Long courseId);

    /**
     * 课程静态化
     * @param courseId
     * @return
     */
    File generateCourseHtml(Long courseId);

    /**
     * 上传课程静态化页面
     * @param courseId
     * @param file
     */
    void uploadCourseHtml(Long courseId, File file);

    /**
     * 查询课程发布信息
     * @param courseId
     * @return
     */
    CoursePublish getCoursePublish(Long courseId);

    /**
     * 查询课程发布信息(先从缓存中查询)
     * @param courseId
     * @return
     */
    CoursePublish getCoursePublishCache(Long courseId);
}
